//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	IEntityFacade.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

namespace Smart.Common.Entities
{
	/// <summary>
	/// List service facade
	/// </summary>
	public interface IEntityFacade<TEntityType>
		where TEntityType : Entity
	{
		/// <summary>
		/// Facade name
		/// </summary>
		string Name { get; }

		/// <summary>
		/// Facade list service
		/// </summary>
		IListService<TEntityType> Service { get; }

		/// <summary>
		/// Query list service
		/// </summary>
		IQueryBuilder<IEntityFacadeQueryExecutor<TEntityType>> Query { get; }

		/// <summary>
		/// Query and return all items
		/// </summary>
		IEntityList<TEntityType> All { get; }

		/// <summary>
		/// Create new entity
		/// </summary>
		TEntityType Create();

		/// <summary>
		/// Query and return item by id
		/// </summary>
		TEntityType GetById(Identifier id);
	}
}